/*
 * Created by SharpDevelop.
 * Author: Joey
 * Date: 09/10/2007
 * Time: 23:44
 * 
 * Source is copyright Joey Sabey 2007
 */

using System;
using System.Collections;
using System.Windows.Forms;

namespace MonoTheism
{
	/// <summary>
	/// Description of BlockController.
	/// </summary>
	public static class BlockController
	{
		public static TreeView RefreshNodes(TreeView tvBuffer)
		{
			tvBuffer.Nodes.Clear();
			for(int x=0; x < BlockData.Blocks.Count; x++)
			{
				Block b = BlockData.Blocks[x];
				TreeNode tn = new TreeNode(b.Name);
				tn.Tag = x;
				tvBuffer.Nodes.Add(b.Name);
			}
			return tvBuffer;
		}
		
		public static void RemoveNode(int index)
		{
			BlockData.Blocks.RemoveAt(index);
		}
	}
}
